#ifndef SOUNDFILE_H_
#define SOUNDFILE_H_

// By: Jesse Guarascia de Urena
// Sound Files class
// Deals with loading and playing a sound file

#include <SDL.h>
#include <SDL_mixer.h>
#include <string>
#include "PlayState.h"
#include "Asset.h"
#include "DebugSys.h"

class SoundFile : public Asset
{
private:
	Mix_Chunk *sound; // Sound file
	int channel; // Channel the sound uses
	PlayState state; // State of the sound file

	void DeleteSound(); // Delete the sound

public:
	SoundFile(void);
	~SoundFile(void);

	void Load(std::string loc); // Load the given sound file
	void Play(int _channel = -1); // Play the sound file

	// Get and set the channel variable
	inline void SetChannel(int _channel) { channel = _channel; }
	inline int GetChannel() { return channel; }
	inline PlayState GetPlayState() { return state; }
	inline void SetPlayState(PlayState _state) { state = _state; }
	
	// Debug the sound file
	std::string Debug();
};

#endif // SOUNDFILE_H_